/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
 * Description:
 * Author: l30050806
 * Create: 2024-12-27
 */

#ifndef TRANSPORT_IPC_MEM_H
#define TRANSPORT_IPC_MEM_H

#include "transport_mem.h"

namespace hccl {
class TransportIpcMem : public TransportMem{
public:
    explicit TransportIpcMem(const std::unique_ptr<NotifyPool> &notifyPool, const HcclNetDevCtx &netDevCtx,
        const HcclDispatcher &dispatcher, u32 localRankId, u32 remoteRankId);
    ~TransportIpcMem() override;
    HcclResult SetSocket(const std::shared_ptr<HcclSocket> &socket) override;
    HcclResult Connect(s32 timeoutSec) override;
    HcclResult Write(const RmaBufferSlice &remoteRmaBufferSlice, const RmaBufferSlice &localRmaBufferSlice, const rtStream_t &stream) override;
    HcclResult Read(const RmaBufferSlice &localRmaBufferSlice, const RmaBufferSlice &remoteRmaBufferSlice, const rtStream_t &stream) override;
    HcclResult AddOpFence(const rtStream_t &stream) override;

private:
HcclResult TransportIpc(
    const RmaBufferSlice &dstRmaBufferSlice, const RmaBufferSlice &srcRmaBufferSlice, const rtStream_t &stream);
};
}  // namespace hccl
#endif